home *** CD-ROM | disk | FTP | other *** search
- <!--- This example shows how to use CFTHROW to
- create an error --->
-
- <HTML>
-
- <HEAD>
- <TITLE>
- CFTHROW Example
- </TITLE>
- </HEAD>
-
- <BASEFONT FACE="Arial, Helvetica" SIZE=2>
-
- <BODY bgcolor="#FFFFD5">
-
- <H3>CFTHROW Example</H3>
-
- <!--- open a CFTRY block --->
- <CFTRY>
- <!--- define a condition upon which to throw
- the error --->
- <CFIF NOT IsDefined("URL.myID")>
- <!--- throw the error --->
- <CFTHROW MESSAGE="ID is not defined">
- </CFIF>
-
- <!--- perform the error catch --->
- <CFCATCH TYPE="application">
- <!--- display your message --->
- <H3>You've Thrown an <B>Error</B></H3>
- <CFOUTPUT>
- <!--- and the diagnostic feedback from the
- application server --->
- <P>#CFCATCH.message#</P>
- <P>The contents of the tag stack are:</P>
- <CFLOOP index=i from=1 to = #ArrayLen(CFCATCH.TAGCONTEXT)#>
- <CFSET sCurrent = #CFCATCH.TAGCONTEXT[i]#>
- <BR>#i# #sCurrent["ID"]# (#sCurrent["LINE"]#,#sCurrent["COLUMN"]#) #sCurrent["TEMPLATE"]#
- </CFLOOP>
- </CFOUTPUT>
- </CFCATCH>
-
- </CFTRY>
-
- </BODY>
-
- </HTML>
-